/**
 * 
 */
package com.lehecai.core.lottery;

import com.lehecai.core.IntegerBeanLabelItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * @author He Wang
 * 配色比赛类型
 */
public class MatchStyleType extends IntegerBeanLabelItem {

	private static final long serialVersionUID = -341142019094299941L;

	private static final Logger logger = LoggerFactory.getLogger(MatchStyleType.class.getName());

	private static List<MatchStyleType> items = new ArrayList<MatchStyleType>();
	private static List<MatchStyleType> _items = new ArrayList<MatchStyleType>();

	protected MatchStyleType(String name, int value, boolean flag) {
		super(MatchStyleType.class.getName(), name, value);
		_items.add(this);
		if (!flag) {
			items.add(this);
		}
	}

	protected MatchStyleType(String name, int value) {
		this(name, value, false);
	}
	
	public static MatchStyleType getItem(int value){
		try {
			return (MatchStyleType) MatchStyleType.getResult(MatchStyleType.class.getName(), value);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}
	
	public static List<MatchStyleType> getItems() {
		return items;
	}
	
	public static List<MatchStyleType> getQueryItems() {
		return _items;
	}

	public static final MatchStyleType ALL = new MatchStyleType("全部", -1 , true);
	public static final MatchStyleType JC = new MatchStyleType("竞彩", 1);
	public static final MatchStyleType BD = new MatchStyleType("北单", 2);


}
